<?php

namespace app\common\model;

class PartsLog extends BaseModel
{
    protected $append = ['status_name'];
    protected $type = [
        "parts_info" => "array",
        "in_time" => "timestamp"
    ];
    protected $jsonType = [
        'parts_info->id'	=>	'int'
    ];
    public function getStatusNameAttr($value,$data)
    {
        $temp = [
            -1 => "未领料",
            1 => "已领料",
        ];
        return $temp[$data['status']] ?? '';
    }
}